home *** CD-ROM | disk | FTP | other *** search
/ isnet Internet / Isnet Internet CD.iso / prog / chat / 12 / 12.exe / SYSTEM / Idle.mrc < prev    next >
Encoding:
Text File  |  1999-03-31  |  7.3 KB  |  196 lines

  1. ;%%%%%%%%%%%%%%%%%%%%%%%%
  2. ;script Idle Scanner
  3. ;version 7.0
  4. ;author Quietust
  5. ;email quietust@ircN.org 
  6. ;url http://www.ircN.org
  7. ;%%%%%%%%%%%%%%%%%%%%%%%%
  8. on 1:CONNECT {
  9.   .remove $tp(idle.txt)
  10.   .remove $tp(idlep.txt)
  11.   if (%idauto == on) { .timer 0 300 idchk | set %idchktimer $ltimer }
  12. }
  13. on 1:INPUT:# {
  14.   if ($left($1,1) != /) return
  15.   if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $active $me $ctime
  16. }
  17. on 1:JOIN:# {
  18.   if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
  19. }
  20. on 1:PART:# {
  21.   if ($isvalidchan(%idchan,$chan)) remini $tp(idle.txt) $chan $nick
  22. }
  23. on 1:QUIT {
  24.   set %i 0
  25.   :start
  26.   inc %i
  27.   if ($comchan($nick,%i)) {
  28.     if ($isvalidchan(%idchan,$comchan($nick,%i))) remini $tp(idle.txt) $comchan($nick,%i) $nick
  29.     goto start
  30.   }
  31. }
  32. on 1:TEXT:*:# {
  33.   if ($isvalidchan(%idchan,$chan)) {
  34.     if (($1- == %idphrase) && (%idtog == on) && ($nick !isop $chan)) .quote kick $chan $nick : $+ %idreason
  35.     else writeini -n $tp(idle.txt) $chan $nick $ctime
  36.   }
  37. }
  38. on 1:NICK {
  39.   set %i 0
  40.   :start
  41.   inc %i
  42.   if ($comchan($newnick,%i)) {
  43.     if ($isvalidchan(%idchan,$comchan($newnick,%i))) {
  44.       remini $tp(idle.txt) $comchan($newnick,%i) $nick
  45.       writeini -n $tp(idle.txt) $comchan($newnick,%i) $newnick $ctime
  46.     }
  47.     goto start
  48.   }
  49. }
  50. on 1:ACTION:*:# {
  51.   if ($isvalidchan(%idchan,$chan)) {
  52.     if (($1- == %idphrase) && (%idtog == on) && ($nick !isop $chan)) .quote kick $chan $nick : $+ %idreason
  53.     else writeini -n $tp(idle.txt) $chan $nick $ctime
  54.   }
  55. }
  56. on 1:KICK:# {
  57.   if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
  58. }
  59. on 1:OP:# {
  60.   if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
  61. }
  62. on 1:DEOP:# {
  63.   if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
  64. }
  65. on 1:VOICE:# {
  66.   if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
  67. }
  68. on 1:DEVOICE:# {
  69.   if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
  70. }
  71. on 1:HELP:# {
  72.   if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
  73. }
  74. on 1:DEHELP:# {
  75.   if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
  76. }
  77. on 1:BAN:# {
  78.   if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
  79. }
  80. on 1:UNBAN:# {
  81.   if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
  82. }
  83. on 1:TOPIC:# {
  84.   if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
  85. }
  86. on 1:MODE:# {
  87.   if ($isvalidchan(%idchan,$chan)) writeini -n $tp(idle.txt) $chan $nick $ctime
  88. }
  89. raw 324:* {
  90.   if ($isvalidchan(%idchan,$2)) idle -r $2
  91. }
  92. alias n.idle return $readini $tp(idle.txt) $1 $2
  93. alias ch.idle {
  94.   if ($n.idle($1,$2)) return $n.idle($1,$2)
  95.   else {
  96.     writeini -n $tp(idle.txt) $1 $2 $ctime
  97.     return $ctime
  98.   }
  99. }
  100. alias idle {
  101.   if (($1 == -r) && ($2)) {
  102.     if ($isvalidchan(%idchan,$2)) {
  103.       set %i 0
  104.       :start
  105.       inc %i
  106.       if ($nick($2,%i) != $null) {
  107.         writeini -n $tp(idle.txt) $2 $nick($2,%i) $ctime
  108.         goto start
  109.       }
  110.     }
  111.     else iecho Error: $hc($2) is not being watched.
  112.   }
  113.   elseif (($1 == -k) && ($2 ischan)) {
  114.     if ($me !isop $2) iecho You are not opped on $hc($2) $+ .
  115.     elseif ($isvalidchan(%idchan,$2)) {
  116.       if ($3) set %idletmp $mpy($3,60)
  117.       elseif (%idlemax) set %idletmp %idlemax
  118.       else set %idletmp 1800
  119.       set %i 0
  120.       :start
  121.       inc %i
  122.       if ($nick($2,%i) == $null) { unset %idletmp | goto end }
  123.       if ($nick($2,%i) isop $2) goto start
  124.       if ($sub($ctime,$ch.idle($2,$nick($2,%i))) > %idletmp) .quote kick $2 $nick($2,%i) :idle $div(%idletmp,60) $+ m
  125.       goto start
  126.       :end
  127.     }
  128.     else iecho Error: $hc($2) is not being watched.
  129.   }
  130.   elseif ($1 == -s) {
  131.     set %idchan $$?="Set channels to watch (type 'all' for all)"
  132.     set %idlemax $mpy(60,$$?="Maximum idle time in minutes (current [ %idlemax ] )")
  133.     set %idphrase $$?="Kick on anti-idle phrase (current [ %idphrase ] )"
  134.     set %ikreason $$?="anti-idle kick reason (current [ %idreason ] )"
  135.   }
  136.   elseif (($1 == -v) && ($2 ischan)) {
  137.     if ($isvalidchan(%idchan,$2)) {
  138.       write -c $tp(idlep.txt)
  139.       write $tp(idlep.txt) close:set $chr(37) $+ iloc $chr(36) $+ swlc(@IdleáStatistics) $chr(124) window -c @IdleáStatistics $chr(124) .remove $tp(idlep.txt)
  140.       write $tp(idlep.txt) -
  141.       set %i 0
  142.       :start
  143.       inc %i
  144.       if ($chan(%i) == $null) {
  145.         window -ae @IdleáStatistics %iloc /idle $tp(idlep.txt)
  146.         aline @IdleáStatistics . $+ $str(-,47) $+ .
  147.         aline @IdleáStatistics $chr(124) Idle Statistics for $fix(25,$hc($2)) $chr(124)
  148.         aline @IdleáStatistics $chr(124) $+ $str(-,47) $+ $chr(124)
  149.         set %i 1
  150.         set %j $nick($2,0)
  151.         :start1
  152.         if (%j > 1) {
  153.           aline @IdleáStatistics $chr(124) $fix(11,$clop($nick($2,%i),$2)) $lfix(9,$sc($rsc($duration($sub($ctime,$ch.idle($2,$nick($2,%i))))))) $chr(124) $fix(11,$clop($nick($2,$pls(1,%i)),$2)) $lfix(9,$sc($rsc($duration($sub($ctime,$ch.idle($2,$nick($2,$pls(1,%i)))))))) $chr(124)
  154.           inc %i 2
  155.           dec %j 2
  156.           goto start1
  157.         }
  158.         if (%j == 1) aline @IdleáStatistics $chr(124) $fix(11,$clop($nick($2,%i),$2)) $lfix(9,$sc($rsc($duration($sub($ctime,$ch.idle($2,$nick($2,%i))))))) $chr(124) $str($chr(160),21) $chr(124)
  159.         aline @IdleáStatistics ' $+ $str(-,23) $+ ' $+ $str(-,23) $+ '
  160.       }
  161.       elseif ($isvalidchan(%idchan,$chan(%i))) {
  162.         write $tp(idlep.txt) $chan(%i)
  163.         if ($me isop $chan(%i)) {
  164.           write $tp(idlep.txt) .kick
  165.           write $tp(idlep.txt) ..10m:idle -k $chan(%i) 10
  166.           write $tp(idlep.txt) ..20m:idle -k $chan(%i) 20
  167.           write $tp(idlep.txt) ..30m:idle -k $chan(%i) 30
  168.           write $tp(idlep.txt) ..N m:idle -k $chan(%i) $chr(36) $+ ?="Enter number of minutes:"
  169.         }
  170.         write $tp(idlep.txt) .nick
  171.         write $tp(idlep.txt) ..view
  172.         write $tp(idlep.txt) ...silent:idle -n $chan(%i) $str($chr(36),2) $+ ?="Enter nickname"
  173.         write $tp(idlep.txt) ...verbose:idle -c $chan(%i) $str($chr(36),2) $+ ?="Enter nickname"
  174.         if ($me isop $chan(%i)) write $tp(idlep.txt) ..kick:.quote kick $chan(%i) $str($chr(36),2) $+ ?="Enter nickname" :idle $chr(36) $+ rsc( $+ $chr(36) $+ duration( $+ $chr(36) $+ sub( $+ $chr(36) $+ ctime, $+ $chr(36) $+ n.idle( $+ $chan(%i) $+ , $chr(36) $+ ! ))))
  175.         write $tp(idlep.txt) .relist:idle -v $chan(%i)
  176.         write $tp(idlep.txt) .-
  177.         write $tp(idlep.txt) .reset:idle -r $chan(%i)
  178.         goto start
  179.       }
  180.       else goto start
  181.     }
  182.     else iecho Error, $hc($2) is not being watched.
  183.   }
  184.   elseif (($1 == -n) && ($3)) {
  185.     if ($nc($3) !ison $2) iecho $hc($3) is not on $hc($nc($2)) $+ .
  186.     elseif ($isvalidchan(%idchan,$2)) iecho $hc($nc($3)) has been idle on $sc($2) for $hc($rsc($duration($sub($ctime,$ch.idle($2,$nc($3))))))
  187.     else iecho Error: $hc($2) is not being watched.
  188.   }
  189.   elseif (($1 == -c) && ($3)) {
  190.     if ($nc($3) !ison $2) iecho $hc($3) is not on $hc($nc($2)) $+ .
  191.     if ($isvalidchan(%idchan,$2)) msg $2 $nc($3) has been idle on $2 for $rsc($duration($sub($ctime,$ch.idle($2,$nc($3)))))
  192.     else iecho Error: $hc($2) is not being watched.
  193.   }
  194.   else iecho Syntax: /idle -<v|k|r|n|c|s> [#channel] [nickname/duration]
  195. }
  196.